"""Definition of the pubinfo content type
"""

from zope.interface import implements

from Products.Archetypes import atapi
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata

# -*- Message Factory Imported Here -*-
from my315ok.xtinfocontent import xtinfocontentMessageFactory as _

from my315ok.xtinfocontent.interfaces import Ipubinfo
from my315ok.xtinfocontent.config import PROJECTNAME

pubinfoSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-

    


    atapi.StringField(
        'category',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"info category"),
            description=_(u""),
        ),
        required=True,
    ),
    atapi.TextField(
        'text',
        storage=atapi.AnnotationStorage(),
        widget=atapi.RichWidget(
            label=_(u"information content"),
            description=_(u""),
        ),
        required=True,
    ),


))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.

pubinfoSchema['title'].storage = atapi.AnnotationStorage()
pubinfoSchema['description'].storage = atapi.AnnotationStorage()

schemata.finalizeATCTSchema(pubinfoSchema, moveDiscussion=False)


class pubinfo(base.ATCTContent):
    """public information"""
    implements(Ipubinfo)

    meta_type = "pubinfo"
    schema = pubinfoSchema

    title = atapi.ATFieldProperty('title')
    description = atapi.ATFieldProperty('description')

    # -*- Your ATSchema to Python Property Bridges Here ... -*-
    text = atapi.ATFieldProperty('text')

    category = atapi.ATFieldProperty('category')


atapi.registerType(pubinfo, PROJECTNAME)
